<?php
namespace Action;
use HY\Action;
!defined('HY_PATH') && exit('HY_PATH not defined.');
class Testconn extends HYBBS {
	public function __construct(){
		parent::__construct();

	}
	public function index(){
        $this->json([
            "state"=>true,
            "datetime"=>date('Y-m-d H:i:s')
        ]);
    }
    //直接测试2000端口 不能改
    public function FASTping(){
        $IP = X('post.ip');
        $port = X('post.port',2000);
        $rs=M("Sysinfo")->execCmd(INDEX_PATH."/FAST/FASTsocket5 ".trim($IP)." -ping");
        $rsArry = explode("\n",trim($rs,"\n"));
        if(strpos($rsArry[0],'not') !== false){
            $this->json([
                "state"=>false,
                "info"=>$rsArry[0]."请检查一级代理运行情况，以及防火墙udp2000",
                //"con"=>$cmdtail
            ]);
        }else{
            $this->json([
                "state"=>true,
                "info"=>$rsArry[0]."可联通udp2000",
            ]);
        }


    }
	
	
	//{hook a_index_fun}
}
